package org.javaboy.consumer01.consumer;

import org.javaboy.consumer01.config.FanoutConfig;
import org.javaboy.consumer01.config.TopicConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TopicConsumer {

    private static final Logger logger = LoggerFactory.getLogger(TopicConsumer.class);

    @RabbitListener(queues = TopicConfig.XIAOMI_QUEUE)
    public void receive(String message) {
        logger.info("TopicConsumer {} 接收到消息: {}", TopicConfig.XIAOMI_QUEUE, message);
    }
    @RabbitListener(queues = TopicConfig.HUAWEI_QUEUE)
    public void receive2(String message) {
        logger.info("TopicConsumer {} 接收到消息: {}", TopicConfig.HUAWEI_QUEUE, message);
    }
    @RabbitListener(queues = TopicConfig.PHONE_QUEUE)
    public void receive3(String message) {
        logger.info("TopicConsumer {} 接收到消息: {}", TopicConfig.PHONE_QUEUE, message);
    }
}
